package com.example.seckillservice2;

import com.example.seckillservice2.mapper.Goods;
import com.example.seckillservice2.mapper.GoodsMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.List;

@SpringBootApplication
public class SeckillService2Application {
    @Autowired
    private GoodsMapper goodsMapper;

    public static void main(String[] args) {
        SpringApplication.run(SeckillService2Application.class, args);

    }

    @Bean
     String test(){
        Goods goods = goodsMapper.selectByPrimaryKey(1L);
        System.out.println(goods);
        return null;
    }

    @Bean
    List<Goods> test2() {
        List<Goods> goods = goodsMapper.selectAll();
        System.out.println(goods);
        return goods;
    }

}
